<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        <el-col :span="8">
          <el-form-item label="耗材分类" prop="FCATNO">
            <el-input v-model="dataForm.FCATNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="耗材名称" prop="FCATNAME">
            <el-input v-model="dataForm.FCATNAME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="领用预估" prop="FQTY1">
            <el-input v-model="dataForm.FQTY"  disabled />
          </el-form-item>
        </el-col>

      </el-form>
    </el-row>

    <el-table :data="list" border stripe>
      <el-table-column prop="FENTRYID" label="序号" width="85"></el-table-column>
      <el-table-column prop="FSTOCK" label="仓库" ></el-table-column>
      <el-table-column prop="FBILLCREDATE" label="日期" ></el-table-column>
      <el-table-column prop="FPOINT" label="场地名称" ></el-table-column>
      <el-table-column prop="FBILLNO" label="单号" ></el-table-column>
      <el-table-column prop="F01" label="申请数量" ></el-table-column>
      <el-table-column prop="FMEMO" label="说明" ></el-table-column>
    </el-table>
    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        title: "查看详情",
        insertorupdate: true,
        dataForm: {
            FCATNO:"玻璃试管",
            FCATNAME:"玻璃实验室器皿200ml",
            FSPEC:"200ml",
            FQTY1:"0",
            FQTY2:"200",
            FQTY3:"35",
            FQTY4:"0",
            FQTY5:"165",
        },
        rules: {
          FUSER: [
            { required: true, message: '请输入领出人员', trigger: 'blur' },
          ],
          FMEMO: [
            { required: true, message: '请输入领出说明', trigger: 'blur' },
          ],
        },
        list: [{  "FENTRYID":1,
                  "FSTOCK": "化学系仓库",
                  "FBILLCREDATE":"2024-12-03",
                  "FPOINT":"奉化学楼101",
                  "FBILLNO":"L2412030001",
                  "F01": "200",
                  "F02":"200",
                  "FMEMO": "化学实验课"
                },
                { "FENTRYID":2,
                  "FSTOCK": "化学系仓库",
                  "FBILLCREDATE":"2024-12-04",
                  "FPOINT":"奉化学楼101",
                  "FBILLNO":"U2412040087",
                  "F01": "35",
                  "F02":"165",
                  "FMEMO": "化学实验课"
                }],
        loading: false,
        visible: false,

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '申请中'
        }, {
          value: '2',
          label: '已通过'
        }, {
          value: '3',
          label: '已驳回'
        }],

        //仓库
        options2: [{
          value: '1',
          label: '化学系仓库'
        }, {
          value: '2',
          label: '生物系仓库'
        }],

        //供应商
        options3: [{
          value: '1',
          label: '奉1教楼101'
        }, {
          value: '2',
          label: '奉1教楼102'
        }, {
          value: '3',
          label: '奉综合楼201'
        }, {
          value: '4',
          label: '奉综合楼202'
        }],
        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      //
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "查看详情"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>